package com.easy.frame.servers.sys.mapper.menu;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.easy.frame.servers.sys.dto.SysMenusCustomDTO;
import com.easy.frame.servers.sys.entity.SysMenusCustom;
import com.easy.frame.servers.sys.vo.SysMenusCustomVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 自定义菜单表 Mapper 接口
 * </p>
 *
 * @author tp
 * @since 2021-01-05
 */
public interface SysMenusCustomMapper extends BaseMapper<SysMenusCustom> {

    List<SysMenusCustom> getEquTypeTree(@Param("enabled") int enabled);

    SysMenusCustomVO selectParentEquById(@Param("parentEquId") Integer parentEquId);

    Integer selectMaxSeq(@Param("parentPath") String parentPath, @Param("level") int level);

    SysMenusCustom checkEquCode(@Param("code") String code);

    SysMenusCustom checkEquName(@Param("name") String name, @Param("parentPath") String parentPath);

    String selectMaxPath(@Param("parentPath") String parentPath);

    int updateLeafNode(SysMenusCustom temp);

    List<SysMenusCustom> selectEquipmentTypebyName
            (@Param("name") String name, @Param("parentPath") String parentPath);

    List<SysMenusCustom> selectEquipmentTypebyLevel
            (@Param("name") String name, @Param("level") Integer level);

    List<SysMenusCustom> selectHaveChild(String path);

    SysMenusCustom selectEquipmentTypeNotEnable(String path);

    SysMenusCustom selectEquipmentTypeByParentpath(String parentPath);

    int countById(@Param("id") Long id);

    int selectByParentPath(String parentPath);

    int updateByParentPath(SysMenusCustom categoryType);

    int updateDelete(@Param("id") Long id);

    List<SysMenusCustom> menuListByName(String menuName);

    List<SysMenusCustomVO> selectForPage(SysMenusCustomDTO param);

    List<String> selectCodeList(@Param("code") String code);

    SysMenusCustomVO selectVoById(@Param("id") Long id);
}
